package com.ts.api.module.api.entity.vo;

import com.ts.api.common.util.H5DomainUrlUtils;
import lombok.Data;

/**
 *  进件结果-VO实体
 *
 *  @author Pan
 */
@Data
public class RespV2ApiApplyVO {

    /** 回调url */
    private String url;
    /** 返回id */
    private String applyId;

    public RespV2ApiApplyVO() {
        super();
    }

    public RespV2ApiApplyVO(String url, String applyId) {
        this.url = url;
        this.applyId = applyId;
    }

    /**
     *  创建无回调地址
     *
     *  @param  applyId
     *  @return RespV2ApiDataExchangeVO
     */
    public static RespV2ApiApplyVO create(String applyId) {
        return new RespV2ApiApplyVO(null, applyId);
    }

    /**
     *  创建回调地址
     *
     *  @param  applyId
     *  @return RespV2ApiDataExchangeVO
     */
    public static RespV2ApiApplyVO create(String applyId, String apiClientId) {
        //  返回自己的授权地址
        String callUrl = H5DomainUrlUtils.createH5CallUrl(applyId, apiClientId);
        return new RespV2ApiApplyVO(callUrl, applyId);
    }
}
